<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>产品查询</title>
    <link rel="stylesheet" href="/static/modules/api/Loanfilter/style/weui.css"/>
    <link rel="stylesheet" href="/static/modules/api/Loanfilter/example.css"/>
</head>
<body ontouchstart>
 

    <div class="container" id="container"></div>

    <script type="text/html" id="tpl_home">
    	<div class="page">
 
    <div class="page__bd">
        <!--<div class="weui-cells__title">单选列表项</div>
        <div class="weui-cells weui-cells_radio">
            <label class="weui-cell weui-check__label" for="x11">
                <div class="weui-cell__bd">
                    <p>cell standard</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" class="weui-check" name="radio1" id="x11">
                    <span class="weui-icon-checked"></span>
                </div>
            </label>
            <label class="weui-cell weui-check__label" for="x12">

                <div class="weui-cell__bd">
                    <p>cell standard</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" name="radio1" class="weui-check" id="x12" checked="checked">
                    <span class="weui-icon-checked"></span>
                </div>
            </label>
            <a href="javascript:void(0);" class="weui-cell weui-cell_link">
                <div class="weui-cell__bd">添加更多</div>
            </a>
        </div>-->
        <!--<div class="weui-cells__title">复选列表项</div>-->
        <div class="weui-top">
          <p>勾选客户已有资料，筛选符合条件的产品！</p>
        </div>
        <div class="weui-cells weui-cells_checkbox">
            <c:forEach  step = '2' items="${materialTypes}" var="materialType" varStatus="status">
            <div class="MeMe">
                <label class="weui-cell" for=${materialType.id}>
                    <div class="weui-cell__hd">
                        <input type="checkbox" class="weui-check" name="checkbox" value="${materialType.id}" id=${materialType.id}>
                        <i class="weui-icon-checked"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <p>${materialType.name}</p>
                    </div>
                </label>
                <c:forEach begin="${status.index+1}" step ='1' end="${status.index+1}"  items="${materialTypes}" var="materialType">
                    <label class="weui-cell weui-check__label" for=${materialType.id}>
                        <div class="weui-cell__hd">
                            <input type="checkbox" class="weui-check" name="checkbox" value="${materialType.id}" id=${materialType.id}>
                            <i class="weui-icon-checked"></i>
                        </div>
                        <div class="weui-cell__bd">
                            <p>${materialType.name}</p>
                        </div>
                    </label>
                </c:forEach>
            </div>
            </c:forEach>
        </div>





        <div class="wgcss_dingwei" onclick="displayDate()">
            <button class="weui-btn weui-btn_primary" type="button" onclick="displayDate()">筛选</button>
        </div>
    </div>

</div>
<script type="text/javascript">
    $(function(){
        var $tooltips = $('.js_tooltips');

        $('#showTooltips').on('click', function(){
            if ($tooltips.css('display') != 'none') return;

            // toptips的fixed, 如果有`animation`, `position: fixed`不生效
            $('.page.cell').removeClass('slideIn');

            $tooltips.css('display', 'block');
            setTimeout(function () {
                $tooltips.css('display', 'none');
            }, 2000);
        });
    });
</script>

    <script src="/static/modules/api/Loanfilter/zepto.min.js"></script>
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="/static/modules/api/Loanfilter/weui.min.js"></script>
    <script src="/static/modules/api/Loanfilter/example.js"></script>
</body>
<script>
    function displayDate (){
        var chk_value =[];//定义一个数组
        var str = "";
        $('input[name="checkbox"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数
            chk_value.push($(this).val());//将选中的值添加到数组chk_value中
            str+=""+$(this).val()+",";

        });
        str =str.substring(0,str.length-1);
        location.href ='/api/loan/getLoanListFilter?ids='+str;
        /*  str =str.substring(0,str.length-1);
         $.ajax({
         url:'/api/loan/getLoanListFilter',
         //          data:{ids:JSON.stringify(chk_value)},
         data:{ids:str},
         type: "post",
         success:function(o){

         alert(ids);
         }
         });*/
    }
</script>
</html>
